home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Periodicals / develop / develop 2 code / Using Objects Safely / ObjectExample.p < prev   
Encoding:
Text File  |  1990-03-29  |  481 b   |  32 lines  |  [TEXT/MPS ]

  1. PROGRAM Test;
  2.  
  3. { Can be built using the MacApp command 'MABuild ObjectExample' }
  4.  
  5. USES
  6.     UMacApp;
  7.  
  8. TYPE
  9.         TShape = OBJECT (TObject)
  10.                  fBounds:      Rect;
  11.                  fColor:        RGBColor;
  12.                  END;
  13.  
  14. VAR
  15.     aShape:                  TShape;
  16.     sameShape, copiedShape: TShape;
  17.  
  18. BEGIN
  19.     InitUMacApp(8);
  20.  
  21.     New(aShape);
  22.     FailNIL(aShape);
  23.     
  24.     aShape.fBounds := gZeroRect;
  25.     aShape.fColor := gRGBBlack;
  26.     
  27.     sameShape := aShape;
  28.     
  29.     copiedShape := TShape(aShape.Clone);
  30.  
  31.     FailNIL(copiedShape);
  32. END.